import request from '@/utils/request'

// 查询预约列表
export function listReservations(query) {
  return request({
    url: '/system/reservation/list',
    method: 'get',
    params: query
  })
}

// 查询预约详细
export function getReservation(id) {
  return request({
    url: '/system/reservation/' + id,
    method: 'get'
  })
}

// 新增预约
export function addReservation(data) {
  return request({
    url: '/system/reservation',
    method: 'post',
    data: data
  })
}

// 修改预约
export function updateReservation(data) {
  return request({
    url: '/system/reservation',
    method: 'put',
    data: data
  })
}

// 删除预约
export function delReservation(id) {
  return request({
    url: '/system/reservation/' + id,
    method: 'delete'
  })
}

// 导出预约
export function exportReservation(query) {
  return request({
    url: '/system/reservation/export',
    method: 'get',
    params: query
  })
}

// 确认预约
export function confirmReservation(id, status) {
  return request({
    url: `/system/reservation/${id}/status`,
    method: 'put',
    data: { status }
  })
}

// 取消预约
export function cancelReservation(id, reason) {
  return request({
    url: `/system/reservation/cancel/${id}`,
    method: 'put',
    params: { reason }
  })
} 